﻿
/** Pete's Animation package */
package pete.animation
{
	import flash.events.Event;
	
	/**
	 * @version
	 * 0.1
	 *
	 * @description 
	 * MoverEvent is dispatched at certain times when animating an object with the Mover Class.
	 * 
	 * @example
	 * <pre>
	 * var custom:Object = {"var1":"Hello, "var2":"World"};
	 * <br />
	 * var event:MoverEvent = new MoverEvent (MoverEvent.MOTION_COMPLETE, custom);
	 * dispatchEvent (event);
	 * <br />
	 * test.addEventListener (MoverEvent.MOTION_COMPLETE, handleMover);
	 * <br />
	 * function handleMover (event:MoverEvent):void
	 * {
	 * 		trace (event.arguments.var1); // "Hello"
	 * 		trace (event.arguments.var2); // "World"
	 * }
	 * </pre>
	 */
	public class MoverEvent extends Event
	{
		/**
		 * Event Type representing the time when a motion is complete.
		 */
		public static const MOTION_COMPLETE:String = "motion complete";
		
		/**
		 * A Object with custom variables to pass through the MoverEvent
		 */
		public var arguments:Object;
		
		
		/**
		 * Creates a new instance of a MoverEvent.
		 * @param type The Type of MoverEvent
		 * @param moverTarget The object controlled by the Mover animation.
		 * @param arguments An Object with custom variables to pass through the MoverEvent.
		 */
		public function MoverEvent (type:String, arguments:Object = null)
		{
			super (type);
			
			if (arguments != null)
			{
				this.arguments = arguments;
			}
		}
		
	}
	
}